
#ifndef INC_GEOMETRY_H_
#define INC_GEOMETRY_H_

#ifdef WIN32 
	#include <windows.h>
#undef max
#undef min
#endif

// Disable warning from VC++ when compiling some templates
#pragma warning (disable : 4786 )
#pragma warning (disable : 4244 )

// Read 3D vector template definition
#include "vector_template.h"

typedef double SCALAR;
typedef T_VECTOR3<SCALAR> VECTOR;
typedef VECTOR COLOR;

#define DEG2RAD 0.0174532925

#ifndef M_PI
#define M_PI 3.14159265358979323846f 
#endif

//Matrix44 class
class Matrix44
{
	public:

		//This matrix works in 
		union { //allows to access the same var using different ways
			struct
			{
				float        _11, _12, _13, _14;
				float        _21, _22, _23, _24;
				float        _31, _32, _33, _34;
				float        _41, _42, _43, _44;
			};
			float M[4][4]; //[row][column]
			float m[16];
		};

		Matrix44();
		Matrix44(const float* v);

		void clear();
		void setIdentity();
		void setZeros();

		//rotate only
		VECTOR rotateVector( const VECTOR& v);
		void setRotation( float angle_in_rad, const VECTOR& axis );

		Matrix44 operator * (const Matrix44& matrix) const;
};

VECTOR operator * (const Matrix44& matrix, const VECTOR& v);


#endif
